package com.ddyx.rest;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.service.GoodsTagService;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;

@Controller
@RequestMapping("/tag")
public class GoodsTagController {
	
	@Resource
	GoodsTagService gtService;
	
	/**
	 * 查询标签列表
	 * @param tagId
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/getTagByStoreNo")
	public ResponseForm getTagByStoreNo(@Param(value = "storeNo") String storeNo) {
		return gtService.getTagByStoreNo(storeNo);
	}
	
	/**
	 * 查询标签分页列表
	 * @param tagId
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/getTagByStoreNoPage")
	public ResponseForm getTagByStoreNoPage(@RequestBody RequestForm param) {
		return gtService.getTagByStoreNoPage(param);
	}
	
	/**
	 * 增加标签
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/addTag" , method = RequestMethod.POST)
	public ResponseForm addTag(@RequestBody RequestForm param) {
		return gtService.addTag(param);
	}
	
	
	/**
	 * 修改标签
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/editTag" , method = RequestMethod.POST)
	public ResponseForm editTag(@RequestBody RequestForm param) {
		return gtService.editTag(param);
	}
	
	/**
	 * 查询指定标签详细信息
	 * @param tagId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getTagById", method = RequestMethod.POST)
	public ResponseForm getTagById(@RequestBody RequestForm param) {
		return gtService.getTagById(param);
	}
	
	
}
